﻿using UnityEngine;
using System.Collections;

public class Button : MonoBehaviour {
	public Sprite spriteMouseEnter;
	private Sprite spriteMouseExit;
	public string Scene;
	private SpriteRenderer renderer;

	// Use this for initialization
	void Start () {
		renderer = GetComponent<SpriteRenderer> ();
		spriteMouseExit = renderer.sprite;
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnMouseEnter()
	{
		renderer.sprite = spriteMouseEnter;
	}

	void OnMouseExit()
	{
		renderer.sprite = spriteMouseExit;
	}

	void OnMouseDown()
	{
		Application.LoadLevel (Scene);
	}
}
